"""未完待续。。。暂时用不到画图，初步了解"""

# 安装 matplotlib
"""pip3 install matplotlib --break-system-packages"""

# 绘制执简单折线图
import matplotlib.pyplot as plt
squares = [1, 4, 9, 16, 25]
fig,ax = plt.subplots()
"""等价于
fig = plt.figure()
ax = fig.subplots()
"""
ax.plot(squares)
plt.show()

## 修改标签文字和线条粗细
import matplotlib.pyplot as plt
squares = [1, 4, 9, 16, 25]
fig, ax = plt.subplots()
ax.plot(squares, linewidth = 3)
    ### 坐标轴加标签
ax.set_title("Square Numbers", fontsize = 24)
ax.set_xlabel("Value", fontsize = 14)
ax.set_ylabel("Square of Vlaue",fontsize=14)
    ### 设置刻度标记的样式
ax.tick_params(labelsize = 14)
plt.show()

## 矫正绘图  即自定义横轴输入
import matplotlib.pyplot as plt
input_values = [1, 2, 3, 4, 5]
squares = [1,4,9,16,25]

fig,ax = plt.subplots()
ax.plot(input_values,squares,linewidth = 3)
    ### 坐标轴加标签
ax.set_title("Square Numbers", fontsize = 24)
ax.set_xlabel("Value", fontsize = 14)
ax.set_ylabel("Square of Vlaue",fontsize=14)
    ### 设置刻度标记的样式
ax.tick_params(labelsize = 14)
plt.show()

## 使用内置样式
import matplotlib.pyplot as plt
print(plt.style.available)
input_values = [1, 2, 3, 4, 5]
squares = [1,4,9,16,25]
plt.style.use("seaborn-v0_8")

fig,ax = plt.subplots()
ax.plot(input_values,squares,linewidth = 3)
    ### 坐标轴加标签
ax.set_title("Square Numbers", fontsize = 24)
ax.set_xlabel("Value", fontsize = 14)
ax.set_ylabel("Square of Vlaue",fontsize=14)
    ### 设置刻度标记的样式
ax.tick_params(labelsize = 14)
plt.show()

"""未完待续。。。暂时用不到画图"""